<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            position: relative;
            height: 200px;
            width: 200px;
            margin: 100px auto;
          

        }

        .box div {
            position: absolute;
            left: 0;
            top: 0;
            height: 100%;
            width: 100%;
            border-radius: 50%;
            font-size: 25px;
            color: #000;
            line-height: 200px;
            text-align: center;
            transition: all 3s;


        }
          /* 第一个盒子背面隐藏起来 */
        .box div:first-child {
            background-color: pink;
            z-index: 1;
            backface-visibility: hidden;

        }
        /* 鼠标放在第一个盒子上,翻成背面,隐藏,第一个盒子,看到第二个盒子正面 */
        .box:hover div:first-child {
            transform: rotateY(180deg);
        }
        /* .box:hover div:last-child {
            transform: rotateY(0deg);
        } */
          /* 第二个盒子反转到背面 */
        .box div:last-child {
            background-color: purple;
            transform: rotateY(180deg);
            
        }

        .box:hover div:last-child {
            transform: rotateY(0);
        }
    </style>
</head>

<body>
    <div class="box">
        <div>黑马</div>
        <div>哈哈哈</div>
    </div>
</body>

</html>